home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / remdobls.lha / remdoubles / remdoubles.asm < prev    next >
Assembly Source File  |  1995-05-28  |  2KB  |  82 lines

  1.  incdir  work:programmieren/include
  2.  include lvo.i
  3.  include dos/dos.i
  4.  
  5.  clr.b   (-1,a0,d0.w)
  6.  move.l  a0,d7
  7.  lea     dosname,a1
  8.  moveq   #37,d0
  9.  move.l  4,a6
  10.  jsr     (_LVOOpenLibrary,a6)
  11.  tst.l   d0
  12.  beq     nodos
  13.  move.l  d0,a6
  14.  move.l  d7,d1
  15.  move.l  #MODE_OLDFILE,d2
  16.  jsr     (_LVOOpen,a6)
  17.  move.l  d0,d7
  18.  beq     nofile
  19.  lea     (-1000,sp),sp   ; eigener speicherbereich 1
  20.  lea     (sp),a5         ; dito 
  21.  lea     (-1000,sp),sp   ; eigener speicherbereich 2
  22.  lea     (sp),a4         ; dito
  23.  move.l  d7,d1           ; altes file
  24.  move.l  a5,d2           ; bufferone einlesen
  25.  move.l  #1000,d3        ; max. länge
  26.  jsr     (_LVOFGets,a6)
  27.  tst.l   d0              ; schon zu ende
  28.  beq     end
  29.  bra     labeltwo
  30. loop
  31.  exg     a5,a4
  32. labeltwo
  33.  move.l  a5,a3           ; bufferone neu
  34.  move.l  a4,a2           ; buffertwo neu
  35.  move.l  d7,d1           ; nochmal altes file einlesen
  36.  move.l  a4,d2           ; buffertwo einlesen
  37.  move.l  #1000,d3        ; max. länge
  38.  jsr     (_LVOFGets,a6)
  39.  tst.l   d0
  40.  beq     writelast       ; war's zu ende, bufferone ausschreiben
  41. subloop
  42.  move.b  (a3)+,d0
  43.  move.b  (a2)+,d1
  44.  cmp.b   #10,d0
  45.  beq     maybediff
  46.  cmp.b   d0,d1
  47.  beq     subloop
  48. write
  49.  move.l  a5,d1
  50.  jsr     (_LVOPutStr,a6)
  51.  bra     loop
  52. maybediff
  53.  cmp.b   #10,d1
  54.  beq     loop
  55.  bra     write
  56. end
  57.  move.l  d7,d1
  58.  jsr     (_LVOClose,a6)
  59.  move.l  a6,a1
  60.  move.l  4,a6
  61.  jsr     (_LVOCloseLibrary,a6)
  62.  lea     2000(sp),sp
  63.  moveq   #0,d0
  64.  rts
  65. nofile
  66.  lea     nofstr,a0
  67.  move.l  a0,d1
  68.  jsr     (_LVOPutStr,a6)
  69. nodos
  70.  moveq   #20,d0
  71.  rts
  72. writelast
  73.  move.l  a5,d1           ; neues file
  74.  jsr     (_LVOPutStr,a6)
  75.  bra     end
  76.  
  77. dosname  dc.b "dos.library",0
  78.      even
  79. nofstr   dc.b "File not found",10,0
  80.  
  81.  end
  82.